<?php

namespace app\admin\model;

use think\Model;

class Program extends Model
{
    // protected $table = 'table_name';
    // protected $pk = 'id';
    public function searchIdAttr($q, $v, $d)
    {
        $q->where('id', '=', $v);
    }

    public static function getProgramList($where)
    {
        $list = Program::withSearch(array_keys($where), $where)->find();
        return $list;
    }
    public static function editProgram($data)
    {
        try {
            $res = Program::update($data);
            $msg = '修改成功';
        } catch (\Exception $th) {
            $res = false;
            $msg = $th->getMessage();
        }
        return [$res, $msg];
    }
}
